package com.crayfish.quduo.utils;

import android.app.Notification;
import android.app.NotificationManager;
import android.content.Context;
import android.graphics.BitmapFactory;
import android.support.v4.app.NotificationCompat;

import com.crayfish.quduo.R;

/**
 * Created by crayfish on 2017/3/15.
 */
public class NoticeUtil {
    public static void showNotice(Context context,String title,String content){
        NotificationManager manager = (NotificationManager) context.getSystemService(context.NOTIFICATION_SERVICE);
        Notification notification = new NotificationCompat.Builder(context)
                .setContentTitle(title)
                .setContentInfo(content)
                .setWhen(System.currentTimeMillis())
                .setSmallIcon(R.mipmap.logo)
                .setLargeIcon(BitmapFactory.decodeResource(context.getResources(),R.mipmap.logo))
                .build();
        manager.notify(1,notification);
    }
}
